home *** CD-ROM | disk | FTP | other *** search
- /*
- ** CTelnetTerminal.h
- **
- ** MiniTelnet application
- ** Telnet session document
- **
- ** Copyright © 1993, FrostByte Design / Eric Scouten
- **
- */
-
-
- #pragma once
-
- #include "CTelnetInterpreter.h"
- #include "MiniTelnet.const.h"
-
- CLASS CTerminalPane;
-
-
- // important resource numbers
-
- #define MENUTelnet 21
- #define WINDTelnet 1026
- #define SCPNTelnet 1026
- #define DLOGSettings 2800
- #define STR_SettingsPrompt 2800
-
-
- // command numbers
-
- #define cmdOpenSettings 2000L // File menu
-
- #define cmdSendSynch 2100L // Telnet menu
- #define cmdSendBreak 2101L
- #define cmdSendAO 2102L
- #define cmdSendIP 2103L
- #define cmdSendAYT 2104L
- #define cmdSendGA 2105L
- #define cmdSendEC 2110L
- #define cmdSendEL 2111L
- #define cmdSendIPAddr 2120L
- #define cmdShowDebug 2199L
-
- #define cmdSaveSettings 2800L // Settings dialog
-
-
- /*______________________________________________________________________
- **
- ** CTelnetTerminal
- **
- ** This class implements the behavior of a terminal connected to Telnet. It uses the
- ** CTerminalPane class to draw the terminal screen. It handles all user events (such as
- ** key-downs) and interacts with CTCPStream to process them.
- **
- ** Some debugging methods are included so that the “behind-the-scenes” negotiation of
- ** Telnet can be viewed on-screen.
- **
- */
-
- class CTelnetTerminal : public CTelnetInterpreter {
-
- public:
- CTerminalPane *itsTerminal; // terminal who displays our I/O
-
- protected:
- TelnetSettingsRec r; // settings record
- short itsTermMode; // which terminal emulation?
-
-
- // initialization
-
- public:
- void ITelnetTerminal (CApplication *aSupervisor, Boolean printable, long recBufferSize,
- b_16 theDefaultPort, short autoReceiveSize, short autoReceiveNum);
-
-
- // creating new sessions
-
- virtual void NewSession (TelnetSettingsRec *theSettings);
- virtual void BuildWindow (void);
- virtual void AutoTitle (void);
-
-
- // command/event handling
-
- virtual void DoCommand (long theCommand);
- virtual void DoKeyDown (char theChar, Byte keyCode, EventRecord *macEvent);
- virtual void DoAutoKey (char theChar, Byte keyCode, EventRecord *macEvent);
- virtual void DoPaste (void);
- virtual void UpdateMenus (void);
-
-
- // data handling methods
-
- virtual void HandleNVTChar (char theChar);
- virtual void HandleNVTLine (char *theLine);
-
-
- // Telnet command handling
-
- virtual void ReceivedDo (uchar theOption);
- virtual void ReceivedAYT (void);
- virtual void ReceivedEC (void);
- virtual void ReceivedEL (void);
- virtual void ReceivedSE (void);
-
-
- // Telnet option handling
-
- virtual void OptionTerminalType (void);
-
-
- // terminal emulation handling
-
- virtual void GetTerminalName (short termIndex, uchar *termStr);
-
-
- // debugging methods
-
- virtual void PrintDebugStr (char *theDebugStr);
- virtual void PrintDebugCharNum (char theChar, char leftBracket, char rightBracket);
-
- };